package com.chris.datacnter.config;



import com.core.data.redis.RedisDataSource;
import com.core.data.redis.RedisUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;


/**
 * Redis集群源配置类
 * 苏斌 2021-8-6
 */
@Configuration
public class MyRedisConfig {


    @Bean(name = "r1")
    @Primary
   // @ConditionalOnBean(RedisDataSource.class)
    public RedisUtil r1(RedisDataSource redisDataSource) {
        return redisDataSource.GetRedisUtil("r1");
    }



}
